<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/views1/DTD/views1-transitional.dtd">
<f:view xmlns="http://www.w3.org/1999/xhtml"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.prime.com.tr/ui">

	<p:dialog header="Desativar Palavra Chave" resizable="false"
		widgetVar="dialogoDesativar" width="500" appendToBody="true"
		modal="true">
		<h:form id="formDesativar">
			<p:panel>
				<center>Deseja realmente desativar este essa palavra chave?</center>
				<div class="div-dialog-spacer">
					<p:separator />
					<br />
					<p:commandButton
						update="formPrincipal, formEdit, formCreate, formDesativar"
						action="#{palavraChaveBean.desativar}" value="Desativar"
						oncomplete="dialogoDesativar.hide()" ajax="true" />
					<p:commandButton type="button" value="Cancelar"
						onclick="dialogoDesativar.hide()" />
				</div>
			</p:panel>
		</h:form>
	</p:dialog>

	<p:dialog header="Editar Palavra Chave" resizable="false"
		widgetVar="dialogoEdit" width="500" appendToBody="true" modal="true">
		<h:form id="formEdit">
			<p:panel>
				<div class="div-dialog-label">Nome:</div>
				<div class="div-dialog-input">
					<p:inputText
						value="#{palavraChaveBean.palavraChaveInstanceTemp.nome}"
						required="true" validator="#{palavraChaveBean.validateNome}"
						requiredMessage="O campo 'Nome' não pode ser nulo!"
						id="palavraChave_nome" styleClass="input-mg" />
				</div>
				<div class="div-dialog-spacer">
					<br />
					<p:separator />
					<br />
					<p:commandButton
						update="formPrincipal, formEdit, formCreate, formDesativar"
						action="#{palavraChaveBean.atualizar}" value="Atualizar"
						onclick="dialogoEdit.hide()" ajax="true" />
					<p:commandButton type="button" value="Cancelar"
						onclick="dialogoEdit.hide()" />
				</div>
			</p:panel>
		</h:form>
	</p:dialog>

	<p:dialog header="Nova Palavra Chave" resizable="false"
		widgetVar="dialogoCreate" width="500" appendToBody="true" modal="true">
		<h:form id="formCreate">
			<p:panel>
				<div class="div-dialog-label">Nome:</div>
				<div class="div-dialog-input">
					<p:inputText value="#{palavraChaveBean.palavraChaveInstance.nome}"
						required="true"
						requiredMessage="O campo 'Nome' não pode ser nulo!"
						validator="#{palavraChaveBean.validateNome}"
						widgetVar="palavraChave_nome" styleClass="input-mg" />
				</div>
				<div class="div-dialog-spacer">
					<br />
					<p:separator />
					<br />
					<p:commandButton
						update="formPrincipal, formCreate, formCreate, formDesativar"
						action="#{palavraChaveBean.salvar}" value="Salvar" ajax="true"
						oncomplete="dialogoCreate.hide()" />
					<p:commandButton type="button" value="Desistir"
						onclick="dialogoCreate.hide()" />
				</div>
			</p:panel>
		</h:form>
	</p:dialog>
</f:view>